package bot.controller;

import bot.pojo.blblreturndata;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/blbl")
public class BilBilController {//调用blbl接口

    @GetMapping("/getdata")
    public Object getdata(){
        String s = HttpHelp.sendGet("api.bilibili.com/x/web-interface/dynamic/region?rid=25");
        blblreturndata blblreturndata = JSONObject.parseObject(s, blblreturndata.class);
        String s1 = JSONObject.toJSONString(blblreturndata.getData().getArchives().get(0));
        return s1;
    }
}
